package to;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name="outcome")
public class OutcomeTO {
	
	private int productId;
	private int outcomeId;
	private int orderId;
	private int cuttingQuality;
	private int sewingQuality;
	private int dyeingQuality;
	private int pressingQuality;
	private String cuttingPassed;
	private String sewingPassed;
	private String dyeingPassed;
	private String pressingPassed;
	private String cuttingError;
	private String sewingError;
	private String dyeingError;
	private String pressingError;
	private boolean passed;
	private ErrorTO error;
	
	
	
	public OutcomeTO(int productId, int outcomeId, int cuttingQuality,
			int sewingQuality, int dyeingQuality, int pressingQuality,
			String cuttingPassed, String sewingPassed, String dyeingPassed,
			String pressingPassed, String cuttingError, String sewingError,
			String dyeingError, String pressingError) {
		super();
		this.productId = productId;
		this.outcomeId = outcomeId;
		this.cuttingQuality = cuttingQuality;
		this.sewingQuality = sewingQuality;
		this.dyeingQuality = dyeingQuality;
		this.pressingQuality = pressingQuality;
		this.cuttingPassed = cuttingPassed;
		this.sewingPassed = sewingPassed;
		this.dyeingPassed = dyeingPassed;
		this.pressingPassed = pressingPassed;
		this.cuttingError = cuttingError;
		this.sewingError = sewingError;
		this.dyeingError = dyeingError;
		this.pressingError = pressingError;
	}

	public OutcomeTO(){}

	public OutcomeTO(int productId, int orderId, int cuttingQuality,
			int sewingQuality, int dyeingQuality, int pressingQuality,
			boolean passed, ErrorTO error) {
		this.productId = productId;
		this.orderId = orderId;
		this.cuttingQuality = cuttingQuality;
		this.sewingQuality = sewingQuality;
		this.dyeingQuality = dyeingQuality;
		this.pressingQuality = pressingQuality;
		this.passed = passed;
		this.error = error;
	}

	public int getOutcomeId() {
		return outcomeId;
	}

	public void setOutcomeId(int outcomeId) {
		this.outcomeId = outcomeId;
	}

	public String getCuttingPassed() {
		return cuttingPassed;
	}

	public void setCuttingPassed(String cuttingPassed) {
		this.cuttingPassed = cuttingPassed;
	}

	public String getSewingPassed() {
		return sewingPassed;
	}

	public void setSewingPassed(String sewingPassed) {
		this.sewingPassed = sewingPassed;
	}

	public String getDyeingPassed() {
		return dyeingPassed;
	}

	public void setDyeingPassed(String dyeingPassed) {
		this.dyeingPassed = dyeingPassed;
	}

	public String getPressingPassed() {
		return pressingPassed;
	}

	public void setPressingPassed(String pressingPassed) {
		this.pressingPassed = pressingPassed;
	}

	public String getCuttingError() {
		return cuttingError;
	}

	public void setCuttingError(String cuttingError) {
		this.cuttingError = cuttingError;
	}

	public String getSewingError() {
		return sewingError;
	}

	public void setSewingError(String sewingError) {
		this.sewingError = sewingError;
	}

	public String getDyeingError() {
		return dyeingError;
	}

	public void setDyeingError(String dyeingError) {
		this.dyeingError = dyeingError;
	}

	public String getPressingError() {
		return pressingError;
	}

	public void setPressingError(String pressingError) {
		this.pressingError = pressingError;
	}

	public int getProductId() {
		return productId;
	}

	public void setProductId(int productId) {
		this.productId = productId;
	}

	public int getOrderId() {
		return orderId;
	}

	public void setOrderId(int orderId) {
		this.orderId = orderId;
	}

	public int getCuttingQuality() {
		return cuttingQuality;
	}

	public void setCuttingQuality(int cuttingQuality) {
		this.cuttingQuality = cuttingQuality;
	}

	public int getSewingQuality() {
		return sewingQuality;
	}

	public void setSewingQuality(int sewingQuality) {
		this.sewingQuality = sewingQuality;
	}

	public int getDyeingQuality() {
		return dyeingQuality;
	}

	public void setDyeingQuality(int dyeingQuality) {
		this.dyeingQuality = dyeingQuality;
	}

	public int getPressingQuality() {
		return pressingQuality;
	}

	public void setPressingQuality(int pressingQuality) {
		this.pressingQuality = pressingQuality;
	}

	public boolean isPassed() {
		return passed;
	}

	public void setPassed(boolean passed) {
		this.passed = passed;
	}

	public ErrorTO getError() {
		return error;
	}

	public void setError(ErrorTO error) {
		this.error = error;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(cuttingQuality);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(dyeingQuality);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((error == null) ? 0 : error.hashCode());
		result = prime * result + orderId;
		result = prime * result + (passed ? 1231 : 1237);
		temp = Double.doubleToLongBits(pressingQuality);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + productId;
		temp = Double.doubleToLongBits(sewingQuality);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		OutcomeTO other = (OutcomeTO) obj;
		if (Double.doubleToLongBits(cuttingQuality) != Double
				.doubleToLongBits(other.cuttingQuality))
			return false;
		if (Double.doubleToLongBits(dyeingQuality) != Double
				.doubleToLongBits(other.dyeingQuality))
			return false;
		if (error == null) {
			if (other.error != null)
				return false;
		} else if (!error.equals(other.error))
			return false;
		if (orderId != other.orderId)
			return false;
		if (passed != other.passed)
			return false;
		if (Double.doubleToLongBits(pressingQuality) != Double
				.doubleToLongBits(other.pressingQuality))
			return false;
		if (productId != other.productId)
			return false;
		if (Double.doubleToLongBits(sewingQuality) != Double
				.doubleToLongBits(other.sewingQuality))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "OutcomeTO [productId=" + productId + ", orderId=" + orderId
				+ ", cuttingQuality=" + cuttingQuality + ", sewingQuality="
				+ sewingQuality + ", dyeingQuality=" + dyeingQuality
				+ ", pressingQuality=" + pressingQuality + ", passed=" + passed
				+ ", error=" + error + "]";
	}

}
